package priv.ljh.operate.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.annotations.ApiModel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import priv.ljh.operate.entity.Newslist;
import priv.ljh.operate.entity.User;

/**
 * <p>
 * 资讯列表 Mapper 接口
 * </p>
 *
 * @author hsy
 * @since 2021-05-01
 */
@Mapper
@Repository
@ApiModel("资讯列表实体接口类")
public interface UserMapper extends BaseMapper<User> {

    @Insert({"insert into user(phone,password) value(#{phone},#{password})"})
    int register(String phone,String password);


    @Update({"update user set username=#{username},identity=#{identity},seller=#{seller} where id=#{id};"})
    int setSeller(String username,String identity,int seller,int id);

    @Select({"select * from user where phone=#{phone}"})
    User selectUser(String phone);

    @Select({"select id from user where phone=#{phone}"})
    int seleteId(String phone);

    @Select({"select seller from user where phone=#{phone}"})
    int seleteSeller(String phone);

    @Update({"update user set password=#{password} where phone=#{phone};"})
    int updatePassword(String password,String phone);

}
